<template>
  <div id="main" style="width: 600px;height:400px;"></div>
</template>

<script>
export default {
  name: "RoleReport",
  data(){
   return {
     option: {
       title: {
         text: '角色人员统计表'
       },
       tooltip: {},
       legend: {
         data: ['人员数量']
       },
       xAxis: {
         data: []
       },
       yAxis: {},
       series: [
         {
           name: '销量',
           type: 'line',
           data: []
         }
       ]
     }
   }
  },mounted() {

    var myChart = this.$echarts.init(document.getElementById('main'))

    this.axios.get(this.$baseUrl+'role/selectCountByPid').then(res=>{
      res.data.data.map(rs=>{
        this.option.xAxis.data.push(rs.name)
        this.option.series[0].data.push(rs.num);
      })
      myChart.setOption(this.option);

    })
  }
}
</script>

<style scoped>

</style>